package com.gsta.ifishery.common.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * netty配置读取 . <br>
 * 
 * @author hkb
 */
@Component
@PropertySource("classpath:config/netty.properties")
public class NettyConfigUtils {

    /**
     * 端口号
     */
    public static int port;

    /**
     * 最大连接数
     */
    public static int maxConnects;

    /**
     * 连接一分钟最大访问数
     */
    public static int maxAccessNum;

    private NettyConfigUtils() {
        super();
    }

    @Value("${netty.port}")
    public void setPort(int port) {
        NettyConfigUtils.port = port;
    }

    @Value("${netty.maxConnects}")
    public void setMaxConnects(int maxConnects) {
        NettyConfigUtils.maxConnects = maxConnects;
    }

    @Value("${netty.maxAccessNum}")
    public void setMaxAccessNum(int maxAccessNum) {
        NettyConfigUtils.maxAccessNum = maxAccessNum;
    }

}
